//
//  LKUFCustomRowCell.m
//  Mideleague_Agent
//
//  Created by Zhiwang on 2020/5/29.
//  Copyright © 2020 Zhiwang. All rights reserved.
//

#import "LKUFCustomRowCell.h"
#import "LKUFCustomBottomRow.h"

@interface LKUFCustomRowCell()

@property(nonatomic,strong)LKUFCustomBottomRow *customRow;

@end


@implementation LKUFCustomRowCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // 自定义UI
//        _leftBtn = [LKBaseButton buttonWithFrame:CGRectZero type:UIButtonTypeCustom title:@"台签" titleColor:yellowDefaultColor layercorne:12 font:[UIFont fontWithName:@"PingFangSC-Regular" size:12] backgroudColor:[UIColor whiteColor] AndActionBlock:^(UIButton * _Nonnull btn) {
//        }];
//        _leftBtn.layer.borderColor = yellowDefaultColor.CGColor;
//        _leftBtn.layer.borderWidth = 1;
//        [self.contentView addSubview:_leftBtn];
//        _rightBtn = [LKBaseButton buttonWithFrame:CGRectZero type:UIButtonTypeCustom title:@"百富" titleColor:yellowDefaultColor layercorne:12 font:[UIFont fontWithName:@"PingFangSC-Regular" size:12] backgroudColor:[UIColor whiteColor] AndActionBlock:^(UIButton * _Nonnull btn) {
//        }];
//         _rightBtn.layer.borderColor = yellowDefaultColor.CGColor;
//        _rightBtn.layer.borderWidth = 1;
//        [self.contentView addSubview:_rightBtn];
//        [_rightBtn mas_makeConstraints:^(MASConstraintMaker *make) {
//            make.right.equalTo(self.contentView).offset(-20);
//            make.centerY.equalTo(self.contentView);
//            make.size.mas_equalTo(CGSizeMake(56, 21));
//        }];
//        [_leftBtn mas_makeConstraints:^(MASConstraintMaker *make) {
//         make.right.equalTo(self.rightBtn.mas_left).offset(-20);
//            make.centerY.equalTo(self.contentView);
//            make.size.mas_equalTo(CGSizeMake(56, 21));
//        }];
    }
    return self;
}

-(void)setRow:(__kindof UFRow *)row{
    _customRow = row;
    [super setRow:row];
    _leftBtn = [LKBaseButton buttonWithFrame:CGRectZero type:UIButtonTypeCustom title:@"台签" titleColor:yellowDefaultColor layercorne:12 font:[UIFont fontWithName:@"PingFangSC-Regular" size:12] backgroudColor:[UIColor whiteColor] AndActionBlock:^(UIButton * _Nonnull btn) {
    }];
    if (_customRow.showLeft) {
        _leftBtn.hidden = NO;
    }else{
        _leftBtn.hidden = YES;
    }
    _leftBtn.layer.borderColor = yellowDefaultColor.CGColor;
    _leftBtn.layer.borderWidth = 1;
    [self.contentView addSubview:_leftBtn];
    _rightBtn = [LKBaseButton buttonWithFrame:CGRectZero type:UIButtonTypeCustom title:@"优惠券" titleColor:yellowDefaultColor layercorne:12 font:[UIFont fontWithName:@"PingFangSC-Regular" size:12] backgroudColor:[UIColor whiteColor] AndActionBlock:^(UIButton * _Nonnull btn) {
    }];
    if (_customRow.showRight) {
        _rightBtn.hidden = NO;
    }else{
        _rightBtn.hidden = YES;
    }
     _rightBtn.layer.borderColor = yellowDefaultColor.CGColor;
    _rightBtn.layer.borderWidth = 1;
    [self.contentView addSubview:_rightBtn];
    [_rightBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.contentView).offset(-20);
        make.centerY.equalTo(self.contentView);
        make.size.mas_equalTo(CGSizeMake(56, 21));
    }];
    [_leftBtn mas_makeConstraints:^(MASConstraintMaker *make) {
     make.right.equalTo(self.rightBtn.mas_left).offset(-20);
        make.centerY.equalTo(self.contentView);
        make.size.mas_equalTo(CGSizeMake(56, 21));
    }];
}
-(void)setupConstraints{
    [super setupConstraints];
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
